Skip to content

feat(backend): add comprehensive end-to-end testing for Smart Contract Oracle Integrator - #1257

Merged
emdevelopa merged 1 commit into
emdevelopa:mainfrom
barry01-hash:feature/be-add-comprehensive-end-to-end-testing-for-smart-contract-oracle-integrator
Jul 26, 2026
Merged

feat(backend): add comprehensive end-to-end testing for Smart Contract Oracle Integrator#1257
emdevelopa merged 1 commit into
emdevelopa:mainfrom
barry01-hash:feature/be-add-comprehensive-end-to-end-testing-for-smart-contract-oracle-integrator

Conversation

@barry01-hash

@barry01-hash barry01-hash commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Closes #1121

Summary

Adds comprehensive end-to-end testing, edge case coverage, and an Express API layer for the Smart Contract Oracle Integrator module.

Changes

New Routes

  • backend/src/routes/oracle.js — Express endpoints for oracle data: GET /api/oracle/:provider/:feed, GET /api/oracle/stats, POST /api/oracle/clear, POST /api/oracle/invalidate

Integration / E2E Tests (9 tests)

  • backend/tests/integration/oracle.test.js — supertest-based HTTP tests covering stats, cache clear, invalidate, provider fetch, cache hits, stale data, error responses (400/502/503), and Prometheus metrics endpoint validation

Edge Case Unit Tests (+34 tests, from 39 → 73)

  • OracleCache: empty/ null/undefined keys, large data, zero/single-entry eviction, interleaved ops, concurrent get/set
  • SmartContractOracleIntegrator: empty params, null/undefined returns, cache isolation, late/duplicate registration, unknown providers, multi-feed params, fetchWithFallback, fetchBatch errors, custom TTLs
  • Circuit Breaker: manual reset, independent provider tracking, success-after-partial-failures
  • Concurrency: concurrent fetch, fetch+invalidation, clear+fetch, rapid sequential ops
  • Prometheus Metrics: cache hit/miss, fetch duration, errors + circuit breaker trips

Verification

  • 79/79 tests pass (73 unit + 9 integration)
  • Pre-existing 32 failures in unrelated files unchanged

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@barry01-hash is attempting to deploy a commit to the Emmanuel's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@barry01-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@emdevelopa
emdevelopa merged commit 888e39c into emdevelopa:main Jul 26, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Add comprehensive end-to-end testing for Smart Contract Oracle Integrator

2 participants